package com.service.gmall.feign.search;

import com.service.gmall.common.result.Result;
import com.service.gmall.model.list.Goods;
import com.service.gmall.model.vo.search.SearchParamVo;
import com.service.gmall.model.vo.search.SearchResponseVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author alpha
 * @className: SearchFeignClient
 * @Description
 */
@FeignClient("service-elasticsearch")
@RequestMapping("/api/inner/rpc/esk")
public interface SearchFeignClient {
    @PostMapping("/goods")
    Result saveGoods(@RequestBody Goods goods);

    @DeleteMapping("/goods/{skuId}")
     Result deleteGoods(@PathVariable("skuId")Long skuId);

    @PostMapping("/goods/search")
    Result<SearchResponseVo> search(@RequestBody SearchParamVo paramVo);

    @GetMapping("/goods/hotscore/{skuId}")
    Result updateHotScore(@PathVariable("skuId") Long skuId,
                          @RequestParam("score") Long score);
}
